package com.xxl.job.admin.core.enums;

/**
 * Description:
 */
public enum DatabaseTypeEnum {
    MYSQL("mysql"),
    ORACLE("oracle");


    private String type;

    public static DatabaseTypeEnum getByType(String type) {
        for (DatabaseTypeEnum databaseTypeEnum : DatabaseTypeEnum.values()) {
            if (databaseTypeEnum.getType().equals(type)) {
                return databaseTypeEnum;
            }
        }
        throw new RuntimeException("not found database type enum by type:" + type);
    }

    DatabaseTypeEnum(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }
}
